void main(){
    List carts = [
    {"count": 2, "price": 10.0, "selected": true},
    {"count": 1, "price": 30.0, "selected": false},
    {"count": 5, "price": 20.0, "selected": true}
  ];
  // 得到购物车是否全选
  bool result = checkAllSelected(carts);
  print(result);
}


bool checkAllSelected(List list){
  for(var i = 0; i<list.length; i++){
    if(!list[i]['selected']){
      return false;
    }
  }
  return true;
}
